PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
package request_test import ( "bytes" "fmt" "io/ioutil" "net/http" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/s3" ) type mockClient struct { *client.Client } type MockInput struct{} type MockOutput struct { States []*MockState } type MockState struct { State *string } func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutput) { op := &request.Operation{ Name: "Mock", HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &MockInput{} } output := &MockOutput{} req := c.NewRequest(op, input, output) req.Data = output return req, output } func BuildNewMockRequest(c *mockClient, in *MockInput) func([]request.Option) (*request.Request, error) { return func(opts []request.Option) (*request.Request, error) { req, _ := c.MockRequest(in) req.ApplyOptions(opts...) return req, nil } } func TestWaiterPathAll(t *testing.T) { svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ Region: aws.String("mock-region"), })} svc.Handlers.Send.Clear() // mock sending svc.Handlers.Unmarshal.Clear() svc.Handlers.UnmarshalMeta.Clear() svc.Handlers.ValidateResponse.Clear() reqNum := 0 resps := []*MockOutput{ { // Request 1 States: []*MockState{ {State: aws.String("pending")}, {State: aws.String("pending")}, }, }, { // Request 2 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("pending")}, }, }, { // Request 3 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("running")}, }, }, } numBuiltReq := 0 svc.Handlers.Build.PushBack(func(r *request.Request) { numBuiltReq++ }) svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { if reqNum >= len(resps) { t.Errorf("too many polling requests made") return } r.Data = resps[reqNum] reqNum++ }) w := request.Waiter{ MaxAttempts: 10, Delay: request.ConstantWaiterDelay(0), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.PathAllWaiterMatch, Argument: "States[].State", Expected: "running", }, }, NewRequest: BuildNewMockRequest(svc, &MockInput{}), } err := w.WaitWithContext(aws.BackgroundContext()) if err != nil { t.Errorf("expect nil, %v", err) } if e, a := 3, numBuiltReq; e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := 3, reqNum; e != a { t.Errorf("expect %v, got %v", e, a) } } func TestWaiterPath(t *testing.T) { svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ Region: aws.String("mock-region"), })} svc.Handlers.Send.Clear() // mock sending svc.Handlers.Unmarshal.Clear() svc.Handlers.UnmarshalMeta.Clear() svc.Handlers.ValidateResponse.Clear() reqNum := 0 resps := []*MockOutput{ { // Request 1 States: []*MockState{ {State: aws.String("pending")}, {State: aws.String("pending")}, }, }, { // Request 2 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("pending")}, }, }, { // Request 3 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("running")}, }, }, } numBuiltReq := 0 svc.Handlers.Build.PushBack(func(r *request.Request) { numBuiltReq++ }) svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { if reqNum >= len(resps) { t.Errorf("too many polling requests made") return } r.Data = resps[reqNum] reqNum++ }) w := request.Waiter{ MaxAttempts: 10, Delay: request.ConstantWaiterDelay(0), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.PathWaiterMatch, Argument: "States[].State", Expected: "running", }, }, NewRequest: BuildNewMockRequest(svc, &MockInput{}), } err := w.WaitWithContext(aws.BackgroundContext()) if err != nil { t.Errorf("expect nil, %v", err) } if e, a := 3, numBuiltReq; e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := 3, reqNum; e != a { t.Errorf("expect %v, got %v", e, a) } } func TestWaiterFailure(t *testing.T) { svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ Region: aws.String("mock-region"), })} svc.Handlers.Send.Clear() // mock sending svc.Handlers.Unmarshal.Clear() svc.Handlers.UnmarshalMeta.Clear() svc.Handlers.ValidateResponse.Clear() reqNum := 0 resps := []*MockOutput{ { // Request 1 States: []*MockState{ {State: aws.String("pending")}, {State: aws.String("pending")}, }, }, { // Request 2 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("pending")}, }, }, { // Request 3 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("stopping")}, }, }, } numBuiltReq := 0 svc.Handlers.Build.PushBack(func(r *request.Request) { numBuiltReq++ }) svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { if reqNum >= len(resps) { t.Errorf("too many polling requests made") return } r.Data = resps[reqNum] reqNum++ }) w := request.Waiter{ MaxAttempts: 10, Delay: request.ConstantWaiterDelay(0), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.PathAllWaiterMatch, Argument: "States[].State", Expected: "running", }, { State: request.FailureWaiterState, Matcher: request.PathAnyWaiterMatch, Argument: "States[].State", Expected: "stopping", }, }, NewRequest: BuildNewMockRequest(svc, &MockInput{}), } err := w.WaitWithContext(aws.BackgroundContext()).(awserr.Error) if err == nil { t.Errorf("expect error") } if e, a := request.WaiterResourceNotReadyErrorCode, err.Code(); e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := "failed waiting for successful resource state", err.Message(); e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := 3, numBuiltReq; e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := 3, reqNum; e != a { t.Errorf("expect %v, got %v", e, a) } } func TestWaiterError(t *testing.T) { svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ Region: aws.String("mock-region"), })} svc.Handlers.Send.Clear() // mock sending svc.Handlers.Unmarshal.Clear() svc.Handlers.UnmarshalMeta.Clear() svc.Handlers.UnmarshalError.Clear() svc.Handlers.ValidateResponse.Clear() reqNum := 0 resps := []*MockOutput{ { // Request 1 States: []*MockState{ {State: aws.String("pending")}, {State: aws.String("pending")}, }, }, { // Request 1, error case retry }, { // Request 2, error case failure }, { // Request 3 States: []*MockState{ {State: aws.String("running")}, {State: aws.String("running")}, }, }, } reqErrs := make([]error, len(resps)) reqErrs[1] = awserr.New("MockException", "mock exception message", nil) reqErrs[2] = awserr.New("FailureException", "mock failure exception message", nil) numBuiltReq := 0 svc.Handlers.Build.PushBack(func(r *request.Request) { numBuiltReq++ }) svc.Handlers.Send.PushBack(func(r *request.Request) { code := 200 if reqNum == 1 { code = 400 } r.HTTPResponse = &http.Response{ StatusCode: code, Status: http.StatusText(code), Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } }) svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { if reqNum >= len(resps) { t.Errorf("too many polling requests made") return } r.Data = resps[reqNum] reqNum++ }) svc.Handlers.UnmarshalMeta.PushBack(func(r *request.Request) { // If there was an error unmarshal error will be called instead of unmarshal // need to increment count here also if err := reqErrs[reqNum]; err != nil { r.Error = err reqNum++ } }) w := request.Waiter{ MaxAttempts: 10, Delay: request.ConstantWaiterDelay(0), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.PathAllWaiterMatch, Argument: "States[].State", Expected: "running", }, { State: request.RetryWaiterState, Matcher: request.ErrorWaiterMatch, Argument: "", Expected: "MockException", }, { State: request.FailureWaiterState, Matcher: request.ErrorWaiterMatch, Argument: "", Expected: "FailureException", }, }, NewRequest: BuildNewMockRequest(svc, &MockInput{}), } err := w.WaitWithContext(aws.BackgroundContext()) if err == nil { t.Fatalf("expected error, but did not get one") } aerr := err.(awserr.Error) if e, a := request.WaiterResourceNotReadyErrorCode, aerr.Code(); e != a { t.Errorf("expect %q error code, got %q", e, a) } if e, a := 3, numBuiltReq; e != a { t.Errorf("expect %d built requests got %d", e, a) } if e, a := 3, reqNum; e != a { t.Errorf("expect %d reqNum got %d", e, a) } } func TestWaiterStatus(t *testing.T) { svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ Region: aws.String("mock-region"), })} svc.Handlers.Send.Clear() // mock sending svc.Handlers.Unmarshal.Clear() svc.Handlers.UnmarshalMeta.Clear() svc.Handlers.ValidateResponse.Clear() reqNum := 0 svc.Handlers.Build.PushBack(func(r *request.Request) { reqNum++ }) svc.Handlers.Send.PushBack(func(r *request.Request) { code := 200 if reqNum == 3 { code = 404 r.Error = awserr.New("NotFound", "Not Found", nil) } r.HTTPResponse = &http.Response{ StatusCode: code, Status: http.StatusText(code), Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } }) w := request.Waiter{ MaxAttempts: 10, Delay: request.ConstantWaiterDelay(0), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.StatusWaiterMatch, Argument: "", Expected: 404, }, }, NewRequest: BuildNewMockRequest(svc, &MockInput{}), } err := w.WaitWithContext(aws.BackgroundContext()) if err != nil { t.Errorf("expect nil, %v", err) } if e, a := 3, reqNum; e != a { t.Errorf("expect %v, got %v", e, a) } } func TestWaiter_ApplyOptions(t *testing.T) { w := request.Waiter{} logger := aws.NewDefaultLogger() w.ApplyOptions( request.WithWaiterLogger(logger), request.WithWaiterRequestOptions(request.WithLogLevel(aws.LogDebug)), request.WithWaiterMaxAttempts(2), request.WithWaiterDelay(request.ConstantWaiterDelay(5*time.Second)), ) if e, a := logger, w.Logger; e != a { t.Errorf("expect logger to be set, and match, was not, %v, %v", e, a) } if len(w.RequestOptions) != 1 { t.Fatalf("expect request options to be set to only a single option, %v", w.RequestOptions) } r := request.Request{} r.ApplyOptions(w.RequestOptions...) if e, a := aws.LogDebug, r.Config.LogLevel.Value(); e != a { t.Errorf("expect %v loglevel got %v", e, a) } if e, a := 2, w.MaxAttempts; e != a { t.Errorf("expect %d retryer max attempts, got %d", e, a) } if e, a := 5*time.Second, w.Delay(0); e != a { t.Errorf("expect %d retryer delay, got %d", e, a) } } func TestWaiter_WithContextCanceled(t *testing.T) { c := awstesting.NewClient() ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} reqCount := 0 w := request.Waiter{ Name: "TestWaiter", MaxAttempts: 10, Delay: request.ConstantWaiterDelay(1 * time.Millisecond), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.StatusWaiterMatch, Expected: 200, }, }, Logger: aws.NewDefaultLogger(), NewRequest: func(opts []request.Option) (*request.Request, error) { req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) req.HTTPResponse = &http.Response{StatusCode: http.StatusNotFound} req.Handlers.Clear() req.Data = struct{}{} req.Handlers.Send.PushBack(func(r *request.Request) { if reqCount == 1 { ctx.Error = fmt.Errorf("context canceled") close(ctx.DoneCh) } reqCount++ }) return req, nil }, } w.SleepWithContext = func(c aws.Context, delay time.Duration) error { context := c.(*awstesting.FakeContext) select { case <-context.DoneCh: return context.Err() default: return nil } } err := w.WaitWithContext(ctx) if err == nil { t.Fatalf("expect waiter to be canceled.") } aerr := err.(awserr.Error) if e, a := request.CanceledErrorCode, aerr.Code(); e != a { t.Errorf("expect %q error code, got %q", e, a) } if e, a := 2, reqCount; e != a { t.Errorf("expect %d requests, got %d", e, a) } } func TestWaiter_WithContext(t *testing.T) { c := awstesting.NewClient() ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} reqCount := 0 statuses := []int{http.StatusNotFound, http.StatusOK} w := request.Waiter{ Name: "TestWaiter", MaxAttempts: 10, Delay: request.ConstantWaiterDelay(1 * time.Millisecond), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.StatusWaiterMatch, Expected: 200, }, }, Logger: aws.NewDefaultLogger(), NewRequest: func(opts []request.Option) (*request.Request, error) { req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) req.HTTPResponse = &http.Response{StatusCode: statuses[reqCount]} req.Handlers.Clear() req.Data = struct{}{} req.Handlers.Send.PushBack(func(r *request.Request) { if reqCount == 1 { ctx.Error = fmt.Errorf("context canceled") close(ctx.DoneCh) } reqCount++ }) return req, nil }, } err := w.WaitWithContext(ctx) if err != nil { t.Fatalf("expect no error, got %v", err) } if e, a := 2, reqCount; e != a { t.Errorf("expect %d requests, got %d", e, a) } } func TestWaiter_AttemptsExpires(t *testing.T) { c := awstesting.NewClient() ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} reqCount := 0 w := request.Waiter{ Name: "TestWaiter", MaxAttempts: 2, Delay: request.ConstantWaiterDelay(1 * time.Millisecond), SleepWithContext: aws.SleepWithContext, Acceptors: []request.WaiterAcceptor{ { State: request.SuccessWaiterState, Matcher: request.StatusWaiterMatch, Expected: 200, }, }, Logger: aws.NewDefaultLogger(), NewRequest: func(opts []request.Option) (*request.Request, error) { req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) req.HTTPResponse = &http.Response{StatusCode: http.StatusNotFound} req.Handlers.Clear() req.Data = struct{}{} req.Handlers.Send.PushBack(func(r *request.Request) { reqCount++ }) return req, nil }, } err := w.WaitWithContext(ctx) if err == nil { t.Fatalf("expect error did not get one") } aerr := err.(awserr.Error) if e, a := request.WaiterResourceNotReadyErrorCode, aerr.Code(); e != a { t.Errorf("expect %q error code, got %q", e, a) } if e, a := 2, reqCount; e != a { t.Errorf("expect %d requests, got %d", e, a) } } func TestWaiterNilInput(t *testing.T) { // Code generation doesn't have a great way to verify the code is correct // other than being run via unit tests in the SDK. This should be fixed // So code generation can be validated independently. client := s3.New(unit.Session) client.Handlers.Validate.Clear() client.Handlers.Send.Clear() // mock sending client.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &http.Response{ StatusCode: http.StatusOK, } }) client.Handlers.Unmarshal.Clear() client.Handlers.UnmarshalMeta.Clear() client.Handlers.ValidateResponse.Clear() client.Config.SleepDelay = func(dur time.Duration) {} // Ensure waiters do not panic on nil input. It doesn't make sense to // call a waiter without an input, Validation will err := client.WaitUntilBucketExists(nil) if err != nil { t.Fatalf("expect no error, but got %v", err) } } func TestWaiterWithContextNilInput(t *testing.T) { // Code generation doesn't have a great way to verify the code is correct // other than being run via unit tests in the SDK. This should be fixed // So code generation can be validated independently. client := s3.New(unit.Session) client.Handlers.Validate.Clear() client.Handlers.Send.Clear() // mock sending client.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &http.Response{ StatusCode: http.StatusOK, } }) client.Handlers.Unmarshal.Clear() client.Handlers.UnmarshalMeta.Clear() client.Handlers.ValidateResponse.Clear() // Ensure waiters do not panic on nil input ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} err := client.WaitUntilBucketExistsWithContext(ctx, nil, request.WithWaiterDelay(request.ConstantWaiterDelay(0)), request.WithWaiterMaxAttempts(1), ) if err != nil { t.Fatalf("expect no error, but got %v", err) } }