github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/fgs/v2/function/GetCode.go (about)

     1  package function
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func GetCode(client *golangsdk.ServiceClient, funcURN string) (*FuncGraphCode, error) {
     9  	raw, err := client.Get(client.ServiceURL("fgs", "functions", funcURN, "code"), nil, nil)
    10  	if err != nil {
    11  		return nil, err
    12  	}
    13  
    14  	var res FuncGraphCode
    15  	err = extract.Into(raw.Body, &res)
    16  	return &res, err
    17  }
    18  
    19  type FuncGraphCode struct {
    20  	FuncURN           string         `json:"func_urn"`
    21  	FuncName          string         `json:"func_name"`
    22  	DomainID          string         `json:"domain_id"`
    23  	Runtime           string         `json:"runtime"`
    24  	CodeType          string         `json:"code_type"`
    25  	CodeURL           string         `json:"code_url"`
    26  	CodeFilename      string         `json:"code_filename"`
    27  	CodeSize          int            `json:"code_size"`
    28  	Digest            string         `json:"digest"`
    29  	LastModified      string         `json:"last_modified"`
    30  	FuncCode          FuncCode       `json:"func_code"`
    31  	DependVersionList []string       `json:"depend_version_list"`
    32  	StrategyConfig    StrategyConfig `json:"strategy_config"`
    33  	Dependencies      []Dependency   `json:"dependencies"`
    34  }